package com.ttg.common.dto;

import com.ttg.common.constant.ParentDateTypeConstant;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;
import java.util.Objects;


/**
 * @author zhangHongYuan
 * @description
 * @date 2024/1/23 11:40
 */
public  class StringDataType extends ParentDateTypeConstant{
    @Override
    public boolean between(BigDecimal value, BigDecimal start, BigDecimal end) {
        return false;
    }

    @Override
    public boolean between() {
        return false;
    }

    @Override
    public boolean notBetween(BigDecimal value, BigDecimal start, BigDecimal end) {
        return false;
    }

    @Override
    public boolean notBetween() {
        return false;
    }

    @Override
    public boolean equalTo(String value, String ratio) {
        if (StringUtils.isBlank(value)||StringUtils.isBlank(ratio)){
            return false;
        }
        if (ratio.contains(";")){
            String[] split = ratio.split(";");
            for (String s : split) {
                if (s.equals(value)){
                    return true;
                }
            }
        }else {
            if (ratio.equals(value)){
                return true;
            }
        }



        return false;
    }

    @Override
    public boolean equalTo() {
        return true;
    }

    @Override
    public boolean notEqualTo(String value, String ratio) {
        if (StringUtils.isBlank(value)||StringUtils.isBlank(ratio)){
            return false;
        }
        if (ratio.contains(";")){
            String[] split = ratio.split(";");
            for (String s : split) {
                if (s.equals(value)){
                    return false;
                }
            }
            return true;
        }else {
            if (!ratio.equals(value)){
                return true;
            }
        }



        return false;
    }

    @Override
    public boolean notEqualTo() {
        return true;
    }

    @Override
    public boolean greaterThan(BigDecimal value, BigDecimal ratio) {
        return false;
    }

    @Override
    public boolean greaterThan() {
        return false;
    }

    @Override
    public boolean lessThan(BigDecimal value, BigDecimal ratio) {
        return false;
    }

    @Override
    public boolean lessThan() {
        return false;
    }

    @Override
    public boolean greaterThanEqualTo(BigDecimal value, BigDecimal ratio) {
        return false;
    }

    @Override
    public boolean greaterThanEqualTo() {
        return false;
    }

    @Override
    public boolean lessThanEqualTo(BigDecimal value, BigDecimal ratio) {
        return false;
    }

    @Override
    public boolean lessThanEqualTo() {
        return false;
    }

    @Override
    public boolean like() {
        return false;
    }
}
